



class Dog(object):
    # n = 'abc'
    name = 'shangguan'
    def __init__(self,name):
        self.name = name
        # self.n = abc
    @classmethod#类方法只能访问类变量，不能访问实例变量
    def eat(self):
        print('%s is eating %s'%(self.name,'food'))

    def talk(self):
        print('%s is talking '% self.name)
d = Dog('ouyang')
d.eat()








